let {rand,stime} =require ("./fun");
//冒泡排序
let n=100000
let arr=rand(n)
function mp(arr,n){
   for(let i=0;i<n;i++){
       for(let j=0;j<n-i;j++){
          if(arr[j+1]<arr[j]){
              [arr[j+1],arr[j]]=[arr[j],arr[j+1]]
          }
       }
   }
   console.log(arr.slice(0,10))
   
}

stime(mp,arr,100000)
//n=100     ---13ms
//n=1000    ---24ms
//n=10000   ---345ms
//n=100000   ---39366ms